package util.general;

 
import javax.swing.ImageIcon;

import util.i3enum.*;
/**
 * 
 * @author ThaiBaoDoan
 *
 */
public class total_Image {
 
	public static String IMG_HARDDISK ="resources/images/hard_disk.png";
	public static String IMG_CDROM ="resources/images/cd_rom.png";
	public static String IMG_REMOVEDISK ="resources/images/usb.png";
	public static String IMG_UNKNOWN ="resources/images/driver_lock.png";
	  public static ImageIcon createImageIcon(String path) {
	        java.net.URL imgURL = total_Image.class.getClassLoader().getResource(path);
	        if (imgURL != null) {
	            return new ImageIcon(imgURL);
	        } else {
	            System.err.println("Couldn't find file: " + "../../"+path);
	            return null;
	        }
	    }
	  public static ImageIcon ImageIconFromDiskType(FileType fileType)
	  {
		  ImageIcon imgIcon = null;
		  switch (fileType)
		  {
		   case  PARTITION_HARDDISK:
			   imgIcon = createImageIcon(IMG_HARDDISK);
			   break;
		   case PARTITION_REMOVEDISK:
			   imgIcon = createImageIcon(IMG_REMOVEDISK);
			   break;
		   case PARTITION_CD_DVD :
			   imgIcon = createImageIcon(IMG_CDROM);
			  break;
		   case PARTITION_HARDDISK_ENCRYPTION :
			   imgIcon = createImageIcon(IMG_UNKNOWN);
			   break;
			 default:
				 break;
		  }
		  return imgIcon;
	  }
	  
}
